home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / cbm / 4174 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.4 KB

  1. Path: usenet.ufl.edu!usenet
  2. From: Michael Ellis <michael@anest4.anest.ufl.edu>
  3. Newsgroups: comp.sys.cbm,comp.os.misc,alt.comp.hardware.homebuilt,comp.sys.apple2,comp.sys.apple2.programmer,comp.sys.atari.8bit
  4. Subject: Re: 6502 Multitasking OS announce
  5. Date: 18 Mar 1996 14:52:30 GMT
  6. Organization: University Of Florida
  7. Message-ID: <4ijtbe$7ca@no-names.nerdc.ufl.edu>
  8. References: <4i94fs$stj@narses.hrz.tu-chemnitz.de> <holger.948.00030EE6@deep.hb.provi.de>
  9. NNTP-Posting-Host: greenwolf.anest.ufl.edu
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.1N (Windows; I; 16bit)
  14.  
  15. holger@deep.hb.provi.de (Holger Bruns) wrote:
  16.  
  17. >An operating system for the 6502 should have some of the properties of CPM. 
  18. >Parameters could be passed into registers and some zeropage locations. 
  19. >The operating system should be invoked with the BRK instruction. This was my 
  20. >latest idea. But it seems so far, I am to late. I do not know, if your system 
  21. >works in this way, Andre. I have not seen your code until now. But you have 
  22. >done the job. My congratulations.
  23. >
  24.  
  25. There are two problems with the above:
  26.  
  27. 1) Passing parameters via registers is not such a great idea on the 6502 because,
  28.    as you know, there are only three of them.  It's very difficult to convery
  29.    any amount of information in 24 total bits of data.  At best you get on address
  30.    and one byte of data.  Not enough really.
  31.  
  32.  
  33. 2) Passing parameters via zero page has problems with the fact that your code will
  34.    NOT be reentrant.  If you propose to do ANY multitasking whatsoever, you must
  35.    write reentrant code.  If you don't, the following will happen:
  36.  
  37.           1. parameters are installed and program jumps to routine
  38.           
  39.           2. timer interrupt comes in and invokes the dispatcher which then
  40.              decides to give time to another task
  41.  
  42.           3. other task determines that the same work needs to be done calls the
  43.              routine of step 1
  44.  
  45.           4. the routine completes and the processor returns to the original task 
  46.  
  47.           5. the original task pulls its parameters out of ram only to find that
  48.              they were corrupted by the last task who stored its parameters in the
  49.              some block of RAM.
  50.  
  51.    The way to get around this is to pass all parameters on the stack, and use separate
  52.    stacks for the separate tasks.
  53.  
  54.  
  55. Hope this helps...
  56.  
  57. Michael Ellis
  58.  
  59.  
  60.  
  61.